<?php

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Sessao
{
	public static function iniciar()
	{
		session_start();
	}
	
	public static function set($chave,$valor)
	{
		if(!empty($chave))
		{
			$chave = md5($chave);
		}
		
		if (empty($valor))
		{
			unset($_SESSION[$chave]);
		}else{
			
			$_SESSION[$chave] = $valor;
		}
	}
	
	public static function get($chave)
	{
		if( !empty($chave) )
		{
			$chave = md5($chave);
			
			if( empty($_SESSION[$chave]) )
			{
				return false;
			}
			
			return ($_SESSION[$chave]);
		}
	}
	
	public static function destroi()
	{
		session_destroy();
	}
	
}

?>